package com.bckj.fastboot.core.lang.func;

import java.io.Serializable;
import java.util.Objects;

@FunctionalInterface
public interface VoidFunc<P> extends Serializable {

    void call(P  p);

    default VoidFunc<P> andThen(VoidFunc<? super P> after) {
        Objects.requireNonNull(after);
        return (P t) -> {
            call(t);
            after.call(t);
        };
    }

    static <P> VoidFunc<P> identity() {
        return t -> { };
    }
}
